import axios from "axios";

export default function request(url, params){
    const instance = axios.create({
      baseURL: 'http://localhost:3000/',
      timeout: 8000
    })

    // 相应拦截器
    // instance.interceptors.response.use(config  => {

    // })

    if (params) {
      params = {
        params: params,
      }
      return instance.get(url, params)
    } else {
      return instance.get(url)
    }
}

    
